﻿/*
*VMukti -- An open source video conferencing platform.
*
* Copyright (C) 2007 - 2008, VMukti Solutions Pvt. Ltd.
*
* Hardik Sanghvi <hardik@vmukti.com>
*
* See http://www.vmukti.com for more information about
* the VMukti project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, forums and mailing lists
* for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
namespace VMukti.Business
{
    public class clsRTCAuthClient
    {
        private string _UserName;
        private string _Password;
        private string _SIPServerIP;
        private string _AuthResult;

        private RTCAudio _objRTCAudio;

        public string UserName
        {
            get
            {
                return _UserName;
            }
            set
            {
                _UserName = value;
            }
        }

        public string Password
        {
            get
            {
                return _Password;
            }
            set
            {
                _Password = value;
            }
        }

        public string SIPServerIP
        {
            get
            {
                return _SIPServerIP;
            }
            set
            {
                _SIPServerIP = value;
            }
        }

        public string AuthResult
        {
            get
            {
                return _AuthResult;
            }
            set
            {
                _AuthResult = value;
            }
        }

        public delegate void DelAuthStatus(string strAuthStatus);
        public event DelAuthStatus EntAuthStatus;

        public clsRTCAuthClient(string pUserName, string pPassword, string pSIPServerIP)
        {
            _objRTCAudio = new RTCAudio(pUserName, pPassword, pSIPServerIP);
            _objRTCAudio.Register();
            _objRTCAudio.Entstatus += new RTCAudio.DelStatus(_objRTCAudio_Entstatus);
        }

        void _objRTCAudio_Entstatus(RTCAudio sender, string status)
        {
            _AuthResult = status;
            if (EntAuthStatus != null)
            {
                EntAuthStatus(status);
            }
        }
    }
}
